
export default function Node (text, name, parent, type, options, subclass) {
  this.text = ''; // 文字标签说明
  this.describe = ''; // 详细描述
  this.name = ''; // 对应option中该节点的键
  // this.key = ''; // 对应option中该节点的键
  this.parent = {}; // 对应option中该节点的父节点
  this.type = ''; // 值类型，对应控件类型，String, Value，Select，CheckBox，Color
  this.options = []; // 列表
  this.subclass = []; // 子类标签

  this.setData = function (text, name, parent, type, options, subclass) {
    this.text = text || '';
    this.name = name || '';
    this.parent = parent || {};
    this.type = type || '';
    this.options = options || [];
    this.subclass = subclass || [];
  };
  this.setData(text, name, parent, type, options, subclass);
}

export const Type = {
  Split: 'split', // 分割线
  String: 'text', // 字符串
  Value: 'value', // 数值
  Boolean: 'bool', // 二值化
  Radio: 'radio', // 单选按钮
  CheckBox: 'check', // 多选按钮
  Option: 'option', // 平铺选项按钮
  Select: 'select', // 下拉列表
  Color: 'color', // 颜色选择
  Colors: 'colors', // 颜色选择平铺
  Range: 'range', // 滑动选择
  Range2: 'range2', // 滑动选择2
  Limit: 'limit', //最大值最小值
  ArraySel: 'arraySel', // 数组 - 下拉选择
  ArrayVal: 'arrayVal', // 数组 - 数值文本框
  ArrayText: 'arrayText', // 数组 - 文本框
  RangeValue: 'rangeValue' // 数值 + 百分比
};

const auto = {value: 'auto', text: '自动'};
const left = {value: 'left', text: '左'};
const right = {value: 'right', text: '右'};
const top = {value: 'top', text: '上'};
const bottom = {value: 'bottom', text: '下'};
const middle = {value: 'middle', text: '中'};
const center = {value: 'center', text: '中'};
const inside = {value: 'inside', text: '内'};
const outside = {value: 'outside', text: '外'};
const insideLeft = {value: 'insideLeft', text: '内左'};
const insideRight = {value: 'insideRight', text: '内右'};
const insideTop = {value: 'insideTop', text: '内上'};
const insideBottom = {value: 'insideBottom', text: '内下'};
// const insideTopLeft = {value: 'insideTopLeft', text: '内左上'};
// const insideBottomLeft = {value: 'insideBottomLeft', text: '内左下'};
// const insideTopRight = {value: 'insideTopRight', text: '内右上'};
// const insideBottomRight = {value: 'insideBottomRight', text: '内右下'};

const start = {value: 'start', text: '起始'};
const end = {value: 'end', text: '结尾'};
const none = {value: 'none', text: '无'};
const arrow = {value: 'arrow', text: '箭头'};

const solid = {value: 'solid', text: '实线'};
const dashed = {value: 'dashed', text: '虚线'};
const dotted = {value: 'dotted', text: '点缀'};

const vertical = {value: 'vertical', text: '垂直'};
const horizontal = {value: 'horizontal', text: '水平'};
const continuous = {value: 'continuous', text: '连续型'};
const piecewise = {value: 'piecewise', text: '分段型'};

export const POS_H = [left, center, right]; // 位置 - 水平
export const POS_V = [top, middle, bottom]; // 位置 - 垂直
export const POS_P = [start, middle, end]; // 位置 - 进度
export const POS_LABEL = ['top', 'left', 'right', 'bottom', 'center', 'inside', 'outside', 'insideLeft',
  'insideRight', 'insideTop', 'insideBottom', 'insideTopLeft', 'insideBottomLeft', 'insideTopRight', 'insideBottomRight']; // 位置 - 标签
export const TEXT_ALIGN = [left, center, right]; // 文字对齐方式
export const FONT_SIZE = [8, 32, 1, 'px']; // 字体大小 - [min, max, step, unit]
export const FONT_LIST = ['宋体', '黑体', '楷体', '隶书', 'Serif', 'Sans-serif', 'Monospace', 'Cursive', 'Fantasy', 'Times New Roman']; // 字体列表
export const ROTATE = [0, 360, 15, '度'];
export const AXIS_SYMBOL = [none, arrow];
export const LINE_TYPE = [solid, dashed, dotted];
export const OPACITY = [0, 1, 0.01, ''];
export const FONT_WEIGHT = ['normal', 'bold', 'bolder', 'lighter', 100, 200, 300, 400, 500, 600, 700, 800, 900];
export const CURSOR = ['default', 'auto', 'pointer', 'crosshair', 'move', 'text', 'wait', 'help', 'e-resize', 'ne-resize', 'nw-resize']; // 鼠标样式
// CURSOR = ['default', 'auto', 'pointer', 'crosshair', 'move', 'text', 'wait', 'help', 'e-resize', 'ne-resize', 'nw-resize', 'n-resize', 'se-resize', 'sw-resize', 's-resize', 'w-resize']; // 字体列表
export const POS = [auto, left, right, top, bottom]; // 位置
export const LAYOUT_HV = [vertical, horizontal]; // 放置方式
export const MAP_TYPE = [continuous, piecewise]; // 映射方式
// export default Node;
